<template>
  <a-card :bordered="false" class="card-area">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <!-- 搜索区域 -->
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="12">
            <a-form-item label="名称" style="margin-left:8px">
              <a-input placeholder="请输入名称" v-model="queryParam.eyName"></a-input>
            </a-form-item>
          </a-col>
<!--          <a-col :md="6" :sm="8">-->
<!--            <a-form-item label="科室" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">-->
<!--              <a-select v-model="queryParam.departmentId" placeholder="请选择排班的科室">-->
<!--                <a-select-option value=''>请选择</a-select-option>-->
<!--                <a-select-option v-for="item in departOption" :key="item.key" :value="item.value">{{ item.title }}-->
<!--                </a-select-option>-->
<!--              </a-select>-->
<!--            </a-form-item>-->
<!--          </a-col>-->
          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-col :md="6" :sm="24">
              <a-button type="primary" @click="searchQuery">查询</a-button>
              <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
            </a-col>
          </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator"  style="margin-top: 5px">
<!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!--     -->
    </div>

    <!-- table区域-begin -->
    <div>
      <!--      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
      <!--        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;-->
      <!--        <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
      <!--      </div>-->

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
           <a @click='handleAccount(record)'>查看客户</a>
            <a-divider type='vertical' />

           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
           </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@comp/jeecg/JDate'
import { queryMyDepartTreeList } from '@api/api'
import { getAction } from '@api/manage'

export default {
  name: "DepartList",
  mixins:[JeecgListMixin],
  components: {
    JDate
  },
  data () {
    return {
      description: '管家列表页面',
      // 查询条件
      queryParam: {"departmentName":""},
      departOption:[],
      // 表头
      columns: [
        {
          title: '管家名称',
          align:"center",
          dataIndex: 'eyName'
        },
        {
          title: '擅长',
          align:"center",
          dataIndex: 'speciality'
        },
        {
          title: '联系电话',
          align:"center",
          dataIndex: 'systemFlag'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align:"center",
          scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        list: "/his/house/keep/list",
        delete: "/his/house/keep",
      },
    }
  },
  computed: {
  },
  created() {
   this.initRequestData();
  },
  methods: {
    initRequestData() {
      let that = this
      queryMyDepartTreeList().then((res) => {
          if (res.success && res.result) {
            that.departOption = res.result
          }
        }
      )
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>